package com.haidung.photojourney.vos;

import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;

public class JourneyMarker {
    private MarkerOptions marker = null;
    private JourneyImage image = null;

    public JourneyMarker(JourneyImage image) {
        this.image = image;
        MarkerOptions option = createMarker(image);
        if (option != null) {
            this.setMarker(option);
        }

    }

    private MarkerOptions createMarker(JourneyImage image) {
        MarkerOptions option = new MarkerOptions()
                .position(new LatLng(
                        image.getLatitue(),
                        image.getLongtitue()))
                .icon(BitmapDescriptorFactory.fromBitmap(image.getThumbnail()));

        return option;
    }

    public JourneyImage getImage() {
        return image;
    }

    public void setImage(JourneyImage image) {
        this.image = image;
    }

    public void setMarker(MarkerOptions marker) {
        this.marker = marker;
    }

    public MarkerOptions getMarker() {
        return marker;
    }
}
